package com.itany.controllers;


import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.websocket.server.PathParam;
import java.io.IOException;

@RestController
@RequestMapping("/map")
public class MapController {
    @RequestMapping("/showMap")
    public void showMap(@RequestParam("gps") String gps, HttpServletRequest request, HttpServletResponse  response){
        try {
            request.setAttribute("gps",gps);
            request.getRequestDispatcher("/manager/showCompanyMap").forward(request,response);
        } catch (IOException | ServletException e) {
            throw new RuntimeException(e);
        }
    }
}
